package cn.k.mapper;


import cn.k.domain.Notice;
import cn.k.qo.NoticeQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface NoticeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Notice record);

    Notice selectByPrimaryKey(Long id);

    List<Notice> selectAll();

    int updateByPrimaryKey(Notice record);

    List<Notice> selectForList(@Param("qo") NoticeQueryObject qo, @Param("releaseStatus") int releaseStatus);

    void updateReleaseStatus(@Param("id") Long id, @Param("releaseStatus") int releaseStatus);

    //批量添加关系表
    void insertRelation(@Param("noticeId") Long id, @Param("employeeId") Long employee1Id, @Param("readId") Integer readId);

    void deleteRelation(@Param("noticeId") Long noticeId, @Param("employeeId") Long employeeId);

    void updateReadRelation(@Param("noticeId") Long noticeId, @Param("employeeId") Long employeeId, @Param("readId") Integer readId);

    Notice selectByReadRelation(@Param("id") Long id, @Param("employeeId") Long employeeId);

    //更新中间表状态
    void updateReadRelation2(@Param("id") Long id, @Param("employeeId") Long employeeId, @Param("status") int status);
}